using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class SEOrderExpMap : EntityTypeConfiguration<SEOrderExp>
    {
        public SEOrderExpMap()
        {
            // Primary Key
            this.HasKey(t => t.FInterID);

            // Properties
            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FDetailID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.FVersion)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FCustOrderNo)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.FTradeClause)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FPayTerms)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FPayTimeDesc)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FShipPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FTransShipPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FDestPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FShipTimeDesc)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FGoodsDesc)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FGoodsMark)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FClauseRemark)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FCustName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FShortCustName)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FCustNameEn)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FAddress)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FAddressEn)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FPhone)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FFax)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FPostalCode)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FContact)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FEmail)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FCorpName)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FShortCorpName)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FCorpNameEn)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FCorpAddress)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FCorpAddressEn)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FCorpPhone)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FCorpFax)
                .IsRequired()
                .HasMaxLength(40);

            this.Property(t => t.FCorpPostalCode)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.FCorpEmail)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("SEOrderExp");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FVersion).HasColumnName("FVersion");
            this.Property(t => t.FValidDate).HasColumnName("FValidDate");
            this.Property(t => t.FAllAmount).HasColumnName("FAllAmount");
            this.Property(t => t.FTradeStyleID).HasColumnName("FTradeStyleID");
            this.Property(t => t.FMidCustID).HasColumnName("FMidCustID");
            this.Property(t => t.FInlandSupplyID).HasColumnName("FInlandSupplyID");
            this.Property(t => t.FCustOrderNo).HasColumnName("FCustOrderNo");
            this.Property(t => t.FLastModyDate).HasColumnName("FLastModyDate");
            this.Property(t => t.FTradeTermID).HasColumnName("FTradeTermID");
            this.Property(t => t.FTradeClause).HasColumnName("FTradeClause");
            this.Property(t => t.FPayTerms).HasColumnName("FPayTerms");
            this.Property(t => t.FPayTime).HasColumnName("FPayTime");
            this.Property(t => t.FPayTimeDesc).HasColumnName("FPayTimeDesc");
            this.Property(t => t.FTradeCountryID).HasColumnName("FTradeCountryID");
            this.Property(t => t.FDestCountryID).HasColumnName("FDestCountryID");
            this.Property(t => t.FTransStyleID).HasColumnName("FTransStyleID");
            this.Property(t => t.FFreightAgentID).HasColumnName("FFreightAgentID");
            this.Property(t => t.FMoreLessRate).HasColumnName("FMoreLessRate");
            this.Property(t => t.FShipPort).HasColumnName("FShipPort");
            this.Property(t => t.FTransShipPort).HasColumnName("FTransShipPort");
            this.Property(t => t.FDestPort).HasColumnName("FDestPort");
            this.Property(t => t.FIsPartial).HasColumnName("FIsPartial");
            this.Property(t => t.FIsTransship).HasColumnName("FIsTransship");
            this.Property(t => t.FShipTime).HasColumnName("FShipTime");
            this.Property(t => t.FShipTimeDesc).HasColumnName("FShipTimeDesc");
            this.Property(t => t.FCommRate).HasColumnName("FCommRate");
            this.Property(t => t.FCommAmount).HasColumnName("FCommAmount");
            this.Property(t => t.FFurtCommRate).HasColumnName("FFurtCommRate");
            this.Property(t => t.FFurtCommAmount).HasColumnName("FFurtCommAmount");
            this.Property(t => t.FInsureTypeID).HasColumnName("FInsureTypeID");
            this.Property(t => t.FInsurePlusRate).HasColumnName("FInsurePlusRate");
            this.Property(t => t.FGoodsDesc).HasColumnName("FGoodsDesc");
            this.Property(t => t.FGoodsMark).HasColumnName("FGoodsMark");
            this.Property(t => t.FClauseRemark).HasColumnName("FClauseRemark");
            this.Property(t => t.FCustName).HasColumnName("FCustName");
            this.Property(t => t.FShortCustName).HasColumnName("FShortCustName");
            this.Property(t => t.FCustNameEn).HasColumnName("FCustNameEn");
            this.Property(t => t.FAddress).HasColumnName("FAddress");
            this.Property(t => t.FAddressEn).HasColumnName("FAddressEn");
            this.Property(t => t.FPhone).HasColumnName("FPhone");
            this.Property(t => t.FFax).HasColumnName("FFax");
            this.Property(t => t.FPostalCode).HasColumnName("FPostalCode");
            this.Property(t => t.FContact).HasColumnName("FContact");
            this.Property(t => t.FEmail).HasColumnName("FEmail");
            this.Property(t => t.FCorpName).HasColumnName("FCorpName");
            this.Property(t => t.FShortCorpName).HasColumnName("FShortCorpName");
            this.Property(t => t.FCorpNameEn).HasColumnName("FCorpNameEn");
            this.Property(t => t.FCorpAddress).HasColumnName("FCorpAddress");
            this.Property(t => t.FCorpAddressEn).HasColumnName("FCorpAddressEn");
            this.Property(t => t.FCorpPhone).HasColumnName("FCorpPhone");
            this.Property(t => t.FCorpFax).HasColumnName("FCorpFax");
            this.Property(t => t.FCorpPostalCode).HasColumnName("FCorpPostalCode");
            this.Property(t => t.FCorpEmail).HasColumnName("FCorpEmail");
            this.Property(t => t.FGoodsMark_Tag).HasColumnName("FGoodsMark_Tag");
        }
    }
}
